import lib
import time

begin = 0
result = 0

def printResult():
    print "result:%d, costs: %fs" % (result, time.time() - begin)

n = 10 ** 6
begin = time.time()
for i in xrange(n):
    result += i
printResult()

begin = time.time()
result = lib.sum(n)
printResult()

